home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EuroCD 3
/
EuroCD 3.iso
/
Programming
/
Python-1.4
/
Demo
/
sockets
/
unicast.py
< prev
Wrap
Text File
|
1998-06-24
|
220b
|
17 lines
# Send UDP broadcast packets
MYPORT = 50000
import sys, time
from socket import *
s = socket(AF_INET, SOCK_DGRAM)
s.bind(('', 0))
while 1:
data = `time.time()` + '\n'
s.sendto(data, ('', MYPORT))
time.sleep(2)